package lapsnake.model.expr;

import lapsnake.model.data.*;

import lapsnake.model.*;
import lapsnake.model.misc.LapKeyword;
import lapsnake.py.ast.ASTHelperFactory; import java.beans.PropertyVetoException;
import org.python.antlr.ast.*;

/**Wrapper class with helper functions for Call nodes*/
public class LapCall extends LapExpression {
	public final SingleChild<LapExpression> func = new SingleChild<>(this, LapExpression.class);
	public final ChildList<LapExpression> args = new ChildList<>(this, LapExpression.class, true);
	public final ChildList<LapKeyword> keywords = new ChildList<>(this, LapKeyword.class, true);
	public final OptionalChild<LapExpression> starArgs = new OptionalChild<>(this, LapExpression.class);
	public final OptionalChild<LapExpression> kwargs = new OptionalChild<>(this, LapExpression.class);
	
	public LapCall(PyAST pyAST, ChildField<? super LapCall> parent, Call node) throws PropertyVetoException {
		super(pyAST, parent, node);
		ASTHelperFactory.makeHelper(pyAST, func, node.getInternalFunc());
		ASTHelperFactory.makeHelpers(pyAST, args, node.getInternalArgs());
		ASTHelperFactory.makeHelpers(pyAST, keywords, node.getInternalKeywords());
		ASTHelperFactory.makeHelper(pyAST, starArgs, node.getInternalStarargs());
		ASTHelperFactory.makeHelper(pyAST, kwargs, node.getInternalKwargs());
		buildTextNodes(node);
	}
}
